﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;

namespace FCS.Emulator
{
    public class UITrueFalse
    {
        private Control _trueFalseControl;

        public UITrueFalse(CheckBox cb)
        {
            _trueFalseControl = cb;
        }

        public void SetState(bool newState)
        {
            if (_trueFalseControl is CheckBox)
            {
                ((CheckBox)_trueFalseControl).IsChecked = newState;
            }
        }

        public bool GetState()
        {
            if (_trueFalseControl is CheckBox)
            {
                return (bool)((CheckBox)_trueFalseControl).IsChecked;
            }
            else
            {
                throw new InvalidOperationException("Tried to perform GetState on an object of unsupported type.");
            }
        }
    }
}
